-
Notifications
You must be signed in to change notification settings - Fork 934
test(travis-cli): migrate tests from ava to jest #910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(travis-cli): migrate tests from ava to jest #910
Conversation
You are awesome and unstoppable! 🚀 If you can, and like to do so, you can enable them and try to fix them. It's ok if you can't solve them, I put this one and other CI vendors on the roadmap for v9 (I just wrote the draft, still want to check with Mario and Hannes before publishing it) Does the git fixture work for Travis here? Or do you need to do a lot of commit hash fetching etc? |
i did some changes to how mocking of git is working to get it working, |
@@ -5,7 +5,7 @@ import {merge} from 'lodash'; | |||
import * as sander from 'sander'; | |||
import stream from 'string-to-stream'; | |||
|
|||
const bin = path.normalize(path.join(__dirname, '../lib/cli.js')); | |||
const bin = require.resolve('../lib/cli.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small update here, this is a little cleaner way to get correct path for all env
@@ -77,7 +77,7 @@ async function lint(args, options) { | |||
} | |||
|
|||
async function log(hash) { | |||
const result = await execa('git', [ | |||
const result = await execa(GIT, [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while doing tests, i found this bug, 'git' command was called directly instead of GIT variable
// Allow to override used bins for testing purposes
const GIT = process.env.TRAVIS_COMMITLINT_GIT_BIN || 'git';
console.log(process.argv); | ||
|
||
const args = process.argv; | ||
args.shift(); // remove node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't want to output node as arg as its just making issues, and it let me remove witch
from tests
args.shift(); // remove node | ||
console.log( | ||
args.map((item, index) => { | ||
return index === 0 ? 'commitlint' : item; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this solves command test result being system depended
We are getting there 🚀 ❤️ |
migrate travis-cli tests from ava to jest
Description
Most of travis-cli tests are commented out, i enabled / fixed some of them,
Should i update commented one to or should i remove it?
i will prefer that they can be enabled, but instead of cloning actual repo we could mock it up
How Has This Been Tested?
Unrelated
Types of changes
Checklist: